﻿Imports System.Math
''' <summary>
''' 单位转化模块
''' </summary>
''' <remarks></remarks>
Public Module UnitsTranslate
    ''''''''''''''''''''''''''''''''''''
    ''探空数据的转换
    '''''''''''''''''''''''''''''''''''''


    ''' <summary>
    ''' 气压 (Double)
    ''' </summary>
    ''' <param name="pa"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function M_FormatPa(ByVal pa As Double) As Double
        pa = pa * 10
        Return pa
    End Function
    ''' <summary>
    ''' 
    ''' </summary>
    ''' <param name="pa"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function MZ_FormatPa(ByVal pa As Double) As Double

        pa = pa / 10
        Return pa
    End Function
    ''' <summary>
    ''' 干球温度 (String)
    ''' </summary>
    ''' <param name="dryTemperature"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function M_FormatDryTemperature(ByVal dryTemperature As Double) As Double
        'Dim d As Double = 0
        Dim Temperature As Double = 0
        'd = CDbl(dryTemperature)
        Temperature = dryTemperature / 10
        'Temperature = CStr(d)
        Return Temperature
    End Function
    Public Function MZ_FormatDryTemperature(ByVal dryTemperature As Double) As Double
        'Dim d As Double = 0
        Dim Temperature As Double = 0
        'd = CDbl(dryTemperature)
        Temperature = dryTemperature * 10
        'Temperature = CStr(d)
        Return Temperature
    End Function

    ''' <summary>
    ''' 露点温度 (String)
    ''' </summary>
    ''' <param name="dewPointTemperature"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function M_FormatDewPointTemperature(ByVal dewPointTemperature As Double) As Double
        'Dim d As Double = 0
        Dim Temperature As Double = 0
        'd = CDbl(dewPointTemperature)
        Temperature = dewPointTemperature / 10
        'Temperature = CStr(d)
        Return Temperature
    End Function
    ''' ''''''''''

    Public Function MZ_FormatDewPointTemperature(ByVal dewPointTemperature As Double) As Double
        'Dim d As Double = 0
        Dim Temperature As Double = 0
        'd = CDbl(dewPointTemperature)
        Temperature = dewPointTemperature * 10
        'Temperature = CStr(d)
        Return Temperature
    End Function
    ''' <summary>
    ''' 风速 [m/s] (String)
    ''' </summary>
    ''' <param name="windSpeed"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function M_FormatWindSpeed(ByVal windSpeed As Double) As Double
        'Dim wind As Double = 0
        Dim speed As Double = 0
        'windSpeed = CInt(windSpeed)
        speed = FormatNumber(windSpeed / 10, 1)
        'speed = CStr(wind)
        Return speed
    End Function
    '
    Public Function MZ_FormatWindSpeed(ByVal windSpeed As Double) As Double
        'Dim wind As Double = 0
        Dim speed As Double = 0
        'windSpeed = CInt(windSpeed)
        speed = windSpeed * 10
        'speed = CStr(wind)
        Return speed
    End Function

    ''''''''''''''''''''''''''''''''''''
    ''现场数据的转换  （暂无）
    '''''''''''''''''''''''''''''''''''''

End Module
